<template>
    <router-view v-if="isRouterAlive"></router-view>
</template>

<script>
import { ref, nextTick, provide } from "vue";
export default {
    name: "App",
    setup() {
        // 局部组件刷新
        const isRouterAlive = ref(true);
        const reload = () => {
            isRouterAlive.value = false;
            nextTick(() => {
                isRouterAlive.value = true;
            });
        };
        provide("reload", reload);
        return {
            isRouterAlive
        }
    },
};
</script>

<style>
@import "./assets/css/main.css";
@import "./assets/css/color-dark.css";
</style>
